<%
    var headContent = {
%>
<style>
  .table-content>thead>tr>th,.table-content>tbody>tr>td{
    width:3%;
  }
</style>
<%
};
%>
<%layout("/common/_layout.html",{head:headContent}){ %>
<%#ajax userTable:{%>
<div class="am-cf am-padding am-margin-0" style="padding:1rem 1.6rem 1.6rem 1rem;">
  <!--  padding:1px 2px 3px 4px;上、右、下,和左   -->
  <div class="am-fl am-cf"> <strong class="am-text-primary am-text-lg">订单管理</strong>
    /
    <small>宽带订单处理</small>
  </div>
</div>
<div class="am-g"></div>
<div class="am-g">
  <%include("broadband_order_query.tpl"){}%>
  <div class="am-u-sm-12 am-u-md-12 am-margin-0" style="padding:0px 1.6rem 1.6rem 1.5rem;">
    <div class="am-btn-toolbar">
      <div class="am-btn-group am-btn-group-xs">
        <%if(so.hasPermission("BROADBAND_ORDER_DELETE")) {%>
        <button type="button" id="deleteButton" disabled="disabled" class="am-btn am-btn-default"  onclick="deleteAll('${base}/broadbandorder/delete')">
          <span class="am-icon-trash-o"></span>
          删除
        </button>
        <%}%></div>
    </div>
  </div>
</div>
<div class="am-g am-padding-0" >
  <div class="am-u-sm-12 am-scrollable-horizontal">
    <!--  padding:1px 2px 3px 4px;上、右、下,和左   -->
    <!-- <table class="am-table  am-table-striped am-table-hover table-main"> -->
    <table class="am-table am-table-bordered am-table-striped am-table-compact am-table-hover table-main am-padding-0 table-content">
      <thead>
        <tr>
          <th class="table-check" style="width:0.1%">
            <input type="checkbox" id="allCheck"></th>
          <th class="table-title">称呼</th>
          <!-- <th class="table-title">服务类型</th> -->
          <th class="table-title">客户号码</th>
          <th class="table-title" >所在城市</th>
          <th class="table-title" >所在区县</th>
          <th class="table-title">宽带名称</th>

          <th class="table-title">其他联系电话</th>
          <th class="table-title">安装小区</th>
          <th class="table-title">成员手机号1</th>
          <th class="table-title">成员手机号2</th>
          <th class="table-title">成员手机号3</th>
          <th class="table-title">期望安装时间</th>
          <!--预约外呼时间 = 提交宽带预约时间 + 2天-->
          <th class="table-title">预约外呼时间</th>
          <th class="table-title">反馈内容</th>
          <th class="table-title">资费代码</th>

          <th class="table-title">渠道编码</th>

          <th class="table-title">预约地址</th>
          <th class="table-title">预约状态</th>
          <th class="table-date">预约日期</th>
          <th class="table-date">预约时间</th>
          <th class="table-date">结单时间</th>
          <th class="table-set am-text-center" style="width:0.1%">操作</th>
        </tr>
      </thead>
      <tbody>
        <%for(list in pager.list!){
            var member_phone = list.member_phone;
            var phone1 = "";
            var phone2 = "";
            var phone3 = "";
            var i = 0;
            if(member_phone != null){
              var phoneArr = strutil.split(member_phone,",");
              for(phone in phoneArr){
                i++;
              }
              if(i == 1){
                phone1 = phoneArr[0];
              }else if(i == 2){
                phone1 = phoneArr[0];
                phone2 = phoneArr[1];
              }else if(i == 3){
                phone1 = phoneArr[0];
                phone2 = phoneArr[1];
                phone3 = phoneArr[2];
              }
            }
          %>
        <tr>
          <td style="width:0.1%">
            <input type="checkbox"  name="ids" value="${list.id}"/>
          </td>
          <td>
              <%if(so.hasPermission("BROADBAND_ORDER_EDIT")) {%>
                <a href="${base}/broadbandorder/edit?id=${list.id}">${list.gender}</a>
              <%}else{%>
                ${list.gender}
              <%}%>
          </td>
          <!-- <td>${list.service_type}</td> -->
          <td>${list.telephone}</td>
          <td>${list.city}</td>
          <td>${list.area}</td>
          <td>${list.name}</td>

          <td>${list.other_contact_phone}</td>
          <td>${list.install_area}</td>
          <td>${phone1}</td>
          <td>${phone2}</td>
          <td>${phone3}</td>
          <td>${list.expected_install_time}</td>
          <td>${list.call_time}</td>
          <td>${list.feed_back}</td>
          <td>${list.business_code}</td>

          <td>${list.num_code}</td>

          <td>${list.install_address}</td>
          <td>${list.reservation_state}</td>
          <td>${list.create_date, dateFormat="yyyy-MM-dd"}</td>
          <td>${list.create_date, dateFormat="HH:mm:ss"}</td>
          <td>${list.end_date, dateFormat="yyyy-MM-dd HH:mm:ss"}</td>
          <td style="width:0.1%">
            <div class="am-btn-toolbar">
              <div class="am-btn-group am-btn-group-xs">
                <%if(so.hasPermission("BROADBAND_ORDER_EDIT")) {%>
                <button type="button" class="am-btn am-btn-default am-btn-xs am-text-secondary am-padding-0" onclick="location.href='${base}/broadbandorder/edit?id=${list.id}'">
                  <span class="am-icon-pencil-square-o"></span>
                  修改
                </button>
                <%}%></div>
            </div>
          </td>
        </tr>
        <%}%></tbody>
    </table>

    <div class="am-cf">
      <!-- 分页 -->
      <%if (pager.list.~size >
      0){%>
      <div class="am-fr">
        <% include("/admin/common_pager.tpl"){}%></div>
      <%}else{%>
      <div class="am-kai">
        <h3>没有找到任何记录!</h3>
      </div>
      <%}%></div>
    <%}%></div>
</div>
<%}%>